package exception;

import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @author Huangjin
 * @version 1.0
 * describe:
 * @date 2023/3/9 16:40
 */
public class AutoCloseableDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了");
        try (
                FileOutputStream fos = new FileOutputStream("./a/fos.dat")
        ) {
            fos.write(1);
        } catch (IOException e) {
            e.printStackTrace();
            System.out.println("Exception");
        }
        System.out.println("程序结束了");
    }
}
